Error returned when iterating over a table???

When iterating over a table, a customer is getting an "Row Parameter is not a row or cell" error.

The code snippet is:

Object rowHead
for rowHead in table(o) do {
Object c
for c in row(rowHead) do { // <-- Error happens on this line
// ...
}
}

It's passed the first iterator, so I trust that object "o" is a table, row, or cell.

I've tried playing with the table (deleting rows, columns, and cells) to try to reproduce the error but have so-far been unsuccessful.

To make things interesting: the customer's data is classified, so I can't get their data to test against. And they're running DOORS 7.1.

If anyone has any hints on what could cause the error to be generated, I'd greatly appreciate hearing them.

Thanks,
Glenn
SystemAdmin - Mon Jun 22 15:57:13 EDT 2009

Re: Error returned when iterating over a table???
llandale - Mon Jun 22 18:03:29 EDT 2009

The following works for me for a simple table with no deletions etc.

Object oT, oR, oC
 
for oT in entire(current Module) do
{  if (!table(oT)) continue
   print "Table\t\t\t" identifier(oT) "\n"
   for oR in table(oT) do
   {  print "\tRow\t\t" identifier(oR) "\n"
      for oC in row(oR) do
      {  print "\t\tCell\t" identifier(oC) "\n"
      }
   }
}

 


I got your error when I mis-typed 'oT' instead of 'oR' in the line 8 loop. I get a similar error at line 6 when I comment out the continue line.

Deleting a row didn't matter. Deleting all the cells of a row didn't matter. I see nothing odd in the doors.exe; the 'row' commands are as documented. I cannot create an object in the table anywhere without the insertRow,Cell,Column commands.

My guess is they have mis-typed something and you aren't seeing the exact DXL.

Barring that, I'd suppose something is hosed. I'd get them to run something like this, where we make sure that the 'table/row/object' commands are working, and perhaps their values aren't corrupted:
for obj in entire mod do
{ if (table(obj)) print identifier(obj) "\tTable\t" (obj."TableType" "") "\n"
if (table(obj)) print identifier(obj) "\tRow \t" (obj."TableType" "") "\n"
if (table(obj)) print identifier(obj) "\tCell \t" (obj."TableType" "") "\n"
}
and make sure that 2nd and 3rd columns match up. If they don't, call IBM.

 

 

 

  • Louie

 

 

Re: Error returned when iterating over a table???
SystemAdmin - Mon Jun 22 18:59:38 EDT 2009

llandale - Mon Jun 22 18:03:29 EDT 2009

The following works for me for a simple table with no deletions etc.

Object oT, oR, oC
 
for oT in entire(current Module) do
{  if (!table(oT)) continue
   print "Table\t\t\t" identifier(oT) "\n"
   for oR in table(oT) do
   {  print "\tRow\t\t" identifier(oR) "\n"
      for oC in row(oR) do
      {  print "\t\tCell\t" identifier(oC) "\n"
      }
   }
}

 


I got your error when I mis-typed 'oT' instead of 'oR' in the line 8 loop. I get a similar error at line 6 when I comment out the continue line.

Deleting a row didn't matter. Deleting all the cells of a row didn't matter. I see nothing odd in the doors.exe; the 'row' commands are as documented. I cannot create an object in the table anywhere without the insertRow,Cell,Column commands.

My guess is they have mis-typed something and you aren't seeing the exact DXL.

Barring that, I'd suppose something is hosed. I'd get them to run something like this, where we make sure that the 'table/row/object' commands are working, and perhaps their values aren't corrupted:
for obj in entire mod do
{ if (table(obj)) print identifier(obj) "\tTable\t" (obj."TableType" "") "\n"
if (table(obj)) print identifier(obj) "\tRow \t" (obj."TableType" "") "\n"
if (table(obj)) print identifier(obj) "\tCell \t" (obj."TableType" "") "\n"
}
and make sure that 2nd and 3rd columns match up. If they don't, call IBM.

 

 

 

  • Louie

 

 

Louie,

Thanks for the suggestions.

The DXL is our DXL, and corruption on their end is unlikely. But still possible, we can check it.

We can certainly add a row(obj) check in the iterators to catch if the table is indeed hosed.

Cheers,
Glenn

Re: Error returned when iterating over a table???
Bob_Swan - Tue Jun 23 03:08:08 EDT 2009

SystemAdmin - Mon Jun 22 18:59:38 EDT 2009
Louie,

Thanks for the suggestions.

The DXL is our DXL, and corruption on their end is unlikely. But still possible, we can check it.

We can certainly add a row(obj) check in the iterators to catch if the table is indeed hosed.

Cheers,
Glenn

OK I'll bite, what's 'hosed'?

"I question not from doubt, but for enlightenment."

Re: Error returned when iterating over a table???
Tony_Goodman - Tue Jun 23 03:46:19 EDT 2009

Bob_Swan - Tue Jun 23 03:08:08 EDT 2009
OK I'll bite, what's 'hosed'?

"I question not from doubt, but for enlightenment."

Wearing tights?

Re: Error returned when iterating over a table???
llandale - Tue Jun 23 14:04:20 EDT 2009

Bob_Swan - Tue Jun 23 03:08:08 EDT 2009
OK I'll bite, what's 'hosed'?

"I question not from doubt, but for enlightenment."

HUBAR - Hosed Up Beyond All Repair

For those of you who got that, no laughing.

  • Louie

Re: Error returned when iterating over a table???
SystemAdmin - Tue Jun 23 15:24:36 EDT 2009

llandale - Tue Jun 23 14:04:20 EDT 2009
HUBAR - Hosed Up Beyond All Repair

For those of you who got that, no laughing.

  • Louie

I feel honored to have started a thread that contains HUBAR. :-)

And in the chance that it could help someone else down the road, the problem went away when the "table" and "row" specifiers were removed from the iterators. The following code does not generate any errors on the same table:

Object o // where o is a table
Object rowHead
for rowHead in o do { // was "table(o)"
Object c
for c in rowHead do { // was "row(rowHead)"
// ...
}
}

Go figure.

Thanks again for the suggestions and the grins.